class Solution(object):
    def twoSum(self, nums, target):
        """
        :type nums: List[int]
        :type target: int
        :rtype: List[int]
        """
        nums_len = len(nums)
        for i in range(0, nums_len):
            l = nums[i]
            if (target-l) in nums[i+1:]:
                j = nums[i+1:].index(target-l)
                return [i, i+j+1]


s = Solution()
nums = [2,7,11,15]
target = 9
result = s.twoSum(nums, target)
print(result)

nums = [3,2,4]
target = 6
result = s.twoSum(nums, target)
print(result)

nums = [3,3]
target = 6
result = s.twoSum(nums, target)
print(result)
